package com.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dao.AdminDAO;
import com.pojo.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService extends ServiceImpl<AdminDAO, Admin> {

    @Autowired
    private AdminDAO userDAO;

    /**
     * 根据用户名查询数量
     * @param uname 用户名
     * @return
     */
    public Long countuName(String uname){
        return userDAO.selectCount(new QueryWrapper<Admin>().eq("username" , uname)) ;
    }
}
